package com.guangzhi.weijianzhi.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

import com.guangzhi.weijianzhi.R;

/**
 * 欢迎界面
 * @author Administrator
 *
 */
public class GuiDeUiTwoActivity extends BaseActivity implements AnimationListener {
	
   private ImageView splashImg;
   private Animation alphaAnimation = null;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.guide_ui_layout);
		splashImg = (ImageView) findViewById(R.id.welcome_logo);
		splashImg.setBackgroundResource(R.drawable.welcome2);
		alphaAnimation = AnimationUtils.loadAnimation(this, R.anim.welcome_anim);   
        alphaAnimation.setFillEnabled(true); //启动Fill保持   
        splashImg.setAnimation(alphaAnimation);   
        alphaAnimation.setAnimationListener(this);  //为动画设置监听   
		
	}

	@Override
	public void onAnimationEnd(Animation animation) {
		// TODO Auto-generated method stub
		splashImg.setVisibility(View.GONE);
		
		Intent intent = new Intent(GuiDeUiTwoActivity.this, MainPageActivity.class);
		intent.putExtra("isResume", true);
		startActivity(intent);
		finish();
	}

	@Override
	public void onAnimationRepeat(Animation animation) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onAnimationStart(Animation animation) {
		// TODO Auto-generated method stub
		
	}
}
